import time

from pymouse import PyMouse
from pykeyboard import PyKeyboard
from selenium import webdriver

dr =webdriver.Chrome()
dr.get('https://www.baidu.com')
r=dr.find_element_by_id('kw').rect
print(r)
x=r.get('x')
y=r.get('y')
x0=int(x)+r.get('width')//2
y0=int(y)+r.get('height')//2+120
print(x0,y0)

pm=PyMouse()
pm.click(x0,y0)
pk=PyKeyboard()
time.sleep(1)
pk.type_string('蜗牛学院')

